package cn.lichenes.controller;

import cn.lichenes.log.SystemLog;
import cn.lichenes.service.EvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

@Controller
public class EvaluateController {

    @Autowired
    private EvaluateService evaluateService;

    @SystemLog(value = "用户评价商品",status = "user")
    @PostMapping("/evaluate")
    public String addEvaluate(Integer pid,Integer oid,String content){
        System.out.println(pid+","+oid+","+content);
        boolean flag = evaluateService.add(oid, content);
        return "redirect:/singleShop/"+pid;
    }
}
